package com.sophossystems.client.asmon.factory;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

import com.sophossystems.client.asmon.dao.ActivityDao;
import com.sophossystems.client.asmon.dao.ClienteDao;
import com.sophossystems.client.asmon.dao.ClientePMoralesDao;
import com.sophossystems.client.asmon.dao.ClientePersonasFisicasDao;
import com.sophossystems.client.asmon.dao.DireccionDao;
import com.sophossystems.client.asmon.dao.DocumentosDao;
import com.sophossystems.client.asmon.dao.FacturaDao;
import com.sophossystems.client.asmon.dao.ModuleDao;
import com.sophossystems.client.asmon.dao.PrivilegeDao;
import com.sophossystems.client.asmon.dao.RecolectaDocDao;
import com.sophossystems.client.asmon.dao.RepresentanteDocDao;
import com.sophossystems.client.asmon.dao.RepresentanteLegalDao;
import com.sophossystems.client.asmon.dao.RoleDao;
import com.sophossystems.client.asmon.dao.ServiciosDao;
import com.sophossystems.client.asmon.dao.TipoPersonaDao;
import com.sophossystems.client.asmon.dao.UserDao;

public class DaoFactory
{
	/**
	 * Method 'createActivityDao'
	 * 
	 * @return ActivityDao
	 */
	public static ActivityDao createActivityDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (ActivityDao) bf.getBean( "ActivityDao" );
	}

	/**
	 * Method 'createClienteDao'
	 * 
	 * @return ClienteDao
	 */
	public static ClienteDao createClienteDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (ClienteDao) bf.getBean( "ClienteDao" );
	}

	/**
	 * Method 'createClientePersonasFisicasDao'
	 * 
	 * @return ClientePersonasFisicasDao
	 */
	public static ClientePersonasFisicasDao createClientePersonasFisicasDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (ClientePersonasFisicasDao) bf.getBean( "ClientePersonasFisicasDao" );
	}

	/**
	 * Method 'createClientePMoralesDao'
	 * 
	 * @return ClientePMoralesDao
	 */
	public static ClientePMoralesDao createClientePMoralesDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (ClientePMoralesDao) bf.getBean( "ClientePMoralesDao" );
	}

	/**
	 * Method 'createDireccionDao'
	 * 
	 * @return DireccionDao
	 */
	public static DireccionDao createDireccionDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (DireccionDao) bf.getBean( "DireccionDao" );
	}

	/**
	 * Method 'createDocumentosDao'
	 * 
	 * @return DocumentosDao
	 */
	public static DocumentosDao createDocumentosDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (DocumentosDao) bf.getBean( "DocumentosDao" );
	}

	/**
	 * Method 'createFacturaDao'
	 * 
	 * @return FacturaDao
	 */
	public static FacturaDao createFacturaDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (FacturaDao) bf.getBean( "FacturaDao" );
	}

	/**
	 * Method 'createModuleDao'
	 * 
	 * @return ModuleDao
	 */
	public static ModuleDao createModuleDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (ModuleDao) bf.getBean( "ModuleDao" );
	}

	/**
	 * Method 'createPrivilegeDao'
	 * 
	 * @return PrivilegeDao
	 */
	public static PrivilegeDao createPrivilegeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (PrivilegeDao) bf.getBean( "PrivilegeDao" );
	}

	/**
	 * Method 'createRecolectaDocDao'
	 * 
	 * @return RecolectaDocDao
	 */
	public static RecolectaDocDao createRecolectaDocDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (RecolectaDocDao) bf.getBean( "RecolectaDocDao" );
	}

	/**
	 * Method 'createRepresentanteDocDao'
	 * 
	 * @return RepresentanteDocDao
	 */
	public static RepresentanteDocDao createRepresentanteDocDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (RepresentanteDocDao) bf.getBean( "RepresentanteDocDao" );
	}

	/**
	 * Method 'createRepresentanteLegalDao'
	 * 
	 * @return RepresentanteLegalDao
	 */
	public static RepresentanteLegalDao createRepresentanteLegalDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (RepresentanteLegalDao) bf.getBean( "RepresentanteLegalDao" );
	}

	/**
	 * Method 'createRoleDao'
	 * 
	 * @return RoleDao
	 */
	public static RoleDao createRoleDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (RoleDao) bf.getBean( "RoleDao" );
	}

	/**
	 * Method 'createServiciosDao'
	 * 
	 * @return ServiciosDao
	 */
	public static ServiciosDao createServiciosDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (ServiciosDao) bf.getBean( "ServiciosDao" );
	}

	/**
	 * Method 'createTipoPersonaDao'
	 * 
	 * @return TipoPersonaDao
	 */
	public static TipoPersonaDao createTipoPersonaDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (TipoPersonaDao) bf.getBean( "TipoPersonaDao" );
	}

	/**
	 * Method 'createUserDao'
	 * 
	 * @return UserDao
	 */
	public static UserDao createUserDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (UserDao) bf.getBean( "UserDao" );
	}

}
